# CCN::IPC::Spool.pm
# Copyright (C) 2006, 2007  Stephane Alnet
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# 

#
# For more information: http://carrierclass.net/
#

use strict; use warnings;

package CCN::IPC::Spool;
use base qw(CCN::Class);

# sub get_local_pk()
# sub message_store()

# ----------- spool request ---------

our $default_priority = 10;

sub spool_request_to($$)
{
    my $self = shift;
    my ($target,$text) = @_;

    # Spool the request for later processing
    return $self->message_store->insert($self->get_local_pk(),$target,$text,$default_priority,undef);
}

sub spool_request($)
{
    my $self = shift;
    my ($text) = @_;
    return $self->spool_request_to($self->get_local_pk(),$text);
}

1;